package com.weishu.core.service.impl;

import com.weishu.core.entity.TbPremisesInfo;
import com.weishu.core.mapper.TbPremisesInfoMapper;
import com.weishu.core.service.ITbPremisesInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 楼盘信息表 服务实现类
 * </p>
 *
 * @author cuidk
 * @since 2021-10-19
 */
@Service
public class TbPremisesInfoServiceImpl extends ServiceImpl<TbPremisesInfoMapper, TbPremisesInfo> implements ITbPremisesInfoService {

    @Resource
    private TbPremisesInfoMapper tbPremisesInfoMapper;

    /**
     * 查询楼盘信息
     * @param tbPremisesInfo 楼盘信息
     * @return
     */
    @Override
    public List<TbPremisesInfo> selectTbPremisesInfoList(TbPremisesInfo tbPremisesInfo) {
        return tbPremisesInfoMapper.selectTbPremisesInfoList(tbPremisesInfo);
    }

    /**
     * 批量删除楼盘
     * @param ids 楼盘id
     * @return
     */
    @Override
    public int deleteTbPremisesInfoByIds(Long[] ids) {
        return tbPremisesInfoMapper.deleteTbPremisesInfoByIds(ids);
    }

    /**
     * 删除楼盘
     * @param id 楼盘id 楼盘id
     * @return
     */
    @Override
    public int deleteTbPremisesInfoById(Long id) {
        return tbPremisesInfoMapper.deleteTbPremisesInfoById(id);
    }

    /**
     * 新增楼盘信息
     * @param tbPremisesInfo 楼盘信息
     * @return
     */
    @Override
    public int insertTbPremisesInfo(TbPremisesInfo tbPremisesInfo) {
        return tbPremisesInfoMapper.insertTbPremisesInfo(tbPremisesInfo);
    }

    @Override
    public List<TbPremisesInfo> querylistloupan() {
        return this.getBaseMapper().querylistloupan();
    }
}
